var zg99 = {

  choujiang:{

    /**
     * 获取抽奖用户信息 
     * data.actid 
     * data.limits 默认100
     * data.phone
     * callback
     */
    getcjusers:function(attr){

      if(!attr.data.actid){
        alert("actid必须设置")
        return false
      }
      if(!attr.data.limits){
        attr.data.limits = 100
      }
      // console.log(attr)

      $.ajax({
        url: '//zg99.offcn.com/index/choujiang/getcjusers/?callback=?',
        type: 'GET',
        dataType: 'jsonp',
        data: attr.data,
        success: attr.callback
      });
    },

    updatejlb:function(actid,data,callback) {
      if(!actid){
        alert("actid必须设置")
        return false
      }else{
        data.actid = actid
      }
      $.ajax({
        url: '//zg99.offcn.com/index/choujiang/updatejlb/?callback=?',
        type: 'GET',
        dataType: 'jsonp',
        data: data,
        success: callback
      });

    }
  },

  /**
   * 获取信息查询数据
   * 
   */
  chaxun:{

    /**
     * 获取辅助表
     */
    getfzinfo:function(actid,data,callback){

      if(!actid){
        alert("actid必须设置")
        return false
      }else{
        data.actid = actid
      }

      if(!data.limits){
        data.limits = 100
      }
      // console.log(attr)

      $.ajax({
        url: '//zg99.offcn.com/index/chaxun/getfzinfo/?callback=?',
        type: 'GET',
        dataType: 'jsonp',
        data: data,
        success: callback
      });
    },

    /**
     * 获取辅助列表信息
     */
    getfylist:function(actid,data,callback){

      if(!actid){
        alert("actid必须设置")
        return false
      }else{
        data.actid = actid
      }

      if(!data.limits){
        data.limits = 100
      }
      // console.log(attr)

      $.ajax({
        url: '//zg99.offcn.com/index/chaxun/getfylist/?callback=?',
        type: 'GET',
        dataType: 'jsonp',
        data: data,
        success: callback
      });
    },

    /**
     * 获取辅助表列信息
     */
    getfzliinfo:function(actid,data,callback){

      if(!actid){
        alert("actid必须设置")
        return false
      }else{
        data.actid = actid
      }

      data.limits = 1
      // console.log(attr)

      $.ajax({
        url: '//zg99.offcn.com/index/chaxun/getfylist/?callback=?',
        type: 'GET',
        dataType: 'jsonp',
        data: data,
        success: function(res){
          let nres = []
          if(res.status == 1){
            data_list = res.lists[0]
            data_list_tags = Object.keys(res.lists[0])
            // console.log(data_list_tags)

            data_list_tags.forEach(res=>{
              if(res != "id" && res != "createtime" && res != "updatetime" && res != "adduser" && res != "status" && res != "disabled" && res != "counts"){
                nres.push(res)
              }
            })


          }else{
            nres = res
          }

          callback(nres)
        }
      });
    },

    /**
     * 写入记录
     */
    writelogs:function(actid,data,callback){
      if(!actid){
        alert("actid必须设置")
        return false
      }else{
        data.actid = actid
      }

      data.limits = 1
      // console.log(attr)

      $.ajax({
        url: '//zg99.offcn.com/index/chaxun/writelogs/?callback=?',
        type: 'GET',
        dataType: 'jsonp',
        data: data,
        success: callback
      });
    },
    /**
     * 获取记录表信息
     */
    getjlinfo:function(actid,data,callback){
      if(!actid){
        alert("actid必须设置")
        return false
      }else{
        data.actid = actid
      }

      data.limits = 1
      // console.log(attr)

      $.ajax({
        url: '//zg99.offcn.com/index/chaxun/getjlinfo/?callback=?',
        type: 'GET',
        dataType: 'jsonp',
        data: data,
        success: callback
      });

    }

  }

}

